﻿<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@page import="com.ufida.ebscg.comm.Constant" %>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>招商银行供应商门户-采购创造价值_商务协同_商务应答_执行中项目_上传投标文件</title>
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<link href="../css/style_add.css" rel="stylesheet" type="text/css" />
<link href="css/collcss.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" type="text/javascript" src="../calendar/WdatePicker.js"></script>
<script language="JavaScript" type="text/javascript" src="../javascript/caltimer.js"></script>
<script language="JavaScript" type="text/javascript" src="../javascript/ajaxdeal.js"></script>
<meta name="vs_defaultClientScript" content="VBScript" />
<meta name="GENERATOR" content="Microsoft FrontPage 4.0"/>
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
</head>

<body style="width:610px">
<!--页面头部开始-->
<div id="main">
<div id="right">
  <table width="610" border="0">
    <tr>
      <td height="30" class="f-12-333333">项目名称：<span class="f-16-b-000000">${projectname}</span></td>
    </tr>
  </table>
    <table width="620" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td width="13"><img src="images/yingda_zbj_001.jpg" width="13" height="76" border="0" /></td>
      <td width="70" background="images/yingda_zbj_002.jpg"><img src="images/yingda_z_001.jpg" width="64" height="63" border="0" /></td>
      <td width="215" valign="top" background="images/yingda_zbj_002.jpg"><table width="215" border="0" cellpadding="0" cellspacing="0" height="62">
        <tr>
          <td height="36"  colspan="8" valign="middle" class="f-14-e57c00">距离投标截止日期还有</td>
        </tr>
        <tr>
          <td width="26" align="center" bgcolor="#e57c00" class="f-20-b-ffffff" id="day"></td>
          <td align="center" class="f-14-b-000000">天</td>
          <td width="27" align="center" bgcolor="#e57c00" class="f-20-b-ffffff" id="hour"></td>
          <td align="center" class="f-14-b-000000">时</td>
          <td width="27" align="center" bgcolor="#e57c00" class="f-20-b-ffffff" id="minute"></td>
          <td align="center" class="f-14-b-000000">分</td>
          <td width="27" align="center" bgcolor="#e57c00" class="f-20-b-ffffff" id="second"></td>
          <td align="center" class="f-14-b-000000">秒</td>
        </tr>
      </table></td>
      <td width="10" align="left" background="images/yingda_zbj_002.jpg"><img src="images/yingda_zbj_004.jpg" width="1" height="57" border="0" /></td>
      <td background="images/yingda_zbj_002.jpg" class="f-12-F60000">注意：请在应答截止时间前进行应答，超过应答截止时间后进行的应答操作为无效操作！</td>
      <td width="13"><img src="images/yingda_zbj_003.jpg" alt="" width="13" height="76" border="0" /></td>
    </tr>
  </table>
  <table width="610" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td width="128" height="15" ></td>
      <td width="176" ></td>
      <td width="96" ></td>
      <td width="210" ></td>
    </tr>
    <tr>
      <td height="35" align="right">发标标题：&nbsp;</td>
      <td align="left">${steppub.release_title }</td>
      <td align="right"> 投标截止日期：&nbsp;</td>
      <td align="left">${steppub.bid_end_ts }</td>
    </tr>
    <tr>
      <td height="35" align="right">发布时间：&nbsp;</td>
      <td align="left">${steppub.release_date }</td>
      <td align="right">开启时间：&nbsp;</td>
      <td align="left">${steppub.unite_open_ts }</td>
    </tr>
    <tr>
      <td height="35" align="right">发布机构：&nbsp;</td>
      <td align="left">${steppub.pk_corp }</td>
      <td align="right">发布人：&nbsp;</td>
      <td align="left">${steppub.pk_person }</td>
    </tr>
    <tr>
      <td align="right" valign="top">内容：&nbsp;</td>
      <td colspan="3" align="left" valign="bottom"><div style="height:80px; overflow:auto;word-break:break-all;word-wrap:break-word;">
        <p>${steppub.release_text }</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
      </div></td>
    </tr>
    <tr>
      <td >&nbsp;</td>
    </tr>
  </table>
  


 <form action="uploadfile.do?type=2&pk_xy_proj_main=${pk_xy_proj_main }"  method ="post" name="downpriceform" id="downpriceform">
 </form>
 
 
 

<!--<div style="width:100%;border-width:1px;border-style:dashed;border-color:blue;" align="center">-->
<!-- <div  style="width:100%;line-height:6mm;cursor:hand" class="f-13-b-2a6ca7" onclick="onshowdiv(this)"  align="left" > -->
<!--<div  style="width:100%;line-height:6mm;cursor:hand" class="f-13-b-2a6ca7"  align="left" >
第一步：文件加密（请将所有需上传附件先行加密）
</div>

<div id="jiam" >
			<font style="font-size:12px; color:red ">请选择文件:    </font>
			<input type="file" name="file" onchange="upfileSign(this,0)" size="200px" />
			<p></p>
			<div id="msgid" style="color:red;font-size:12px; width:400px;line-height:6mm" align="left">
			</div>
</div>
</div>
 -->
 
<!-- 上传文件 -->
<form action="uploadfile.do"  enctype="MULTIPART/FORM-DATA" method ="post" name="insertPriceItemForm">
<div style="width:100%;border-width:1px;border-style:dashed;border-color:blue;margin-top:20px" align="center">

    <input type = "hidden" value="1" name="type"/>
    <input type="hidden" name="pk_xy_proj_main" value="${pk_xy_proj_main }"/>
     <table width="610" border="0" cellpadding="0" cellspacing="0" height="120" class="xian" >
    <tr>
      <td valign="middle">
      <table width="610" border="0" cellpadding="0" cellspacing="0" id="fileuploadtable">
      
      <tr>
      <td height="50" align="left" class="f-13-b-2a6ca7" colspan='4'>第一步：上传投标文件(上传采购文件时，必须将报价文件、技术商务文件分开独立上传，技术商务文件中如含有任何价格信息，我行有权视为无效响应，一切后果由供应商自行承担)
      </td>
      </tr>
      <tr>
      <td height="50" align="left" class="f-13-b-2a6ca7" colspan='4'>
		<p style="font-size:10pt;color:red;margin-top:5px">提示：如果在添加上传文件时无法选择文件或上传文件不成功，请先参照首页公告下的相关文件上传操作手册对浏览器进行设置后再行操作！</p>
      </td>
      </tr>
      <tr class="th_bj">
            <td width="100" height="28" align="center" class="f-12-b-ffffff"  >序</td>
            <td width="320" height="28" align="center"  ><span class="f-12-b-ffffff" >文件名称</span></td>
            <td align="center" width='100px'><span class="f-12-b-ffffff" >附件类型</span></td>
            <td height="28" width = 100px; align="center" class="f-12-b-ffffff"  ><img src="../images/botton_add.jpg"  border="0" onclick = "addRow()"  style="cursor:hand"/></td>
      </tr>
      </table>
      </td>
    </tr>
  </table>
  </div>
  
  <p>&nbsp;</p>

	 <table width="610" border="0" cellpadding="0" cellspacing="0" >
	   <tr>
	      <td height="26" align="left" class="f-13-b-2a6ca7" colspan='2'>已上传投标文件列表</td>
	 
	    </tr>
	    
	    <tr class="newth_bj">
	      <td width="10%"   height="28" align="center" class="f-12-b-ffffff"  >序</td>
	      <td width="50%"  height="28" align="center"><span class="f-12-b-ffffff">文件名称</span></td>
	      <td width="20%"  height="28" align="center"><span class="f-12-b-ffffff">附件类型</span></td>
	      <td width="20%"  height="28" align="center"><span class="f-12-b-ffffff">操作</span></td>
	    </tr>
	    
	    <logic:iterate id="att" name="atts">
	    <tr >
	      <td width="10%"   height="28" align="center"   >${att.index }</td>
	      <td width="50%"  height="28" align="center">${att.filename }</td>
	       <td width="20%"  height="28" align="center">${att.pub_type_name }</td>
	      <td id="${att.pk_da_att}" class ="center" width="200px"><img src="../images/botton_delete.jpg" style='cursor:hand' border=0 onclick="deleteFile('${att.pk_da_att}',${dismill})" style="border-width:0"/></td>
	    </tr>
	    </logic:iterate>
	    <tr>
	      <td colspan="4" height="1" bgcolor="#7f98ae"></td>
	    </tr>
	  
	  </table>  
  <span>&nbsp;</span>
  
<div style="width:100%;border-width:1px;border-style:dashed;border-color:blue;margin-top:20px" align="left"> 
<div  style="width:100%;line-height:6mm;cursor:hand" class="f-13-b-2a6ca7"  align="left" >
第二步：填写价格信息
</div>
<p style="font-size:10pt;color:red;margin-top:5px">填写价格说明：<br>

1、供应商可通过【导入报价信息】上传报价信息或通过【增加报价信息】逐条添加报价信息；<br>
2、所有的报价信息栏位均由供应商如实填写，除“备注”选项之外，其它所有选项都为必填项。供应商须确保“列表单价”、“正折扣率（%）”、“折扣后单价”、“折扣后总价”的正确性，系统对此不做自动处理。<br>
3、所有数字栏系统只保留三位小数，如填写时超出，系统将自动截取前三位小数。<br>
4、“正折扣率（%）”填写规则为：“60”表示正折扣率为“60%”，即目录单价×0.6=折扣后单价，对于无折扣项目，此栏填写为100。<br>

</p>
&nbsp;
<br>

 <!-- 报价信息 -->


<!--   gh  20140114 修改	
<div  style="width:100%;line-height:6mm;cursor:hand" class="f-13-b-2a6ca7"  align="left" >
方式一：附件上传方式
</div>
					
		<table width="610px" border="0" cellpadding="0" cellspacing="1" >
		
		<tr>
			//<!--  <td width="610px" align='left' class="f-13-b-2a6ca7">价格模板</td>-->
<!--   gh  20130114 修改			</tr>
					<tr class="th_bj" >
										
							<td  height="28" width="150px"  align="center" class="f-13-ffffff">
											产品/服务名称
							</td>
								
							<td width="260px" align="center" class="f-13-ffffff">
											详细描述
							</td>
									
							<td width="100px" height="28" colspan="-3" align="center">
											<span class="f-13-ffffff">规格</span>
							</td>
							<td width="70px" align="center" class="f-13-ffffff">
											数量
							</td>
							<td width="100px" align="center" class="f-13-ffffff">
											单位
							</td>
							
					</tr>

									
										
								
				<logic:iterate id="supplierprice" name="supplierprices">
					<tr>
						<td width="100px" height="30" align="center" bgcolor="#E8EBF0">
							<bean:write name="supplierprice" property="prod_name" />
							<input type="hidden"
								value=<bean:write name="supplierprice" property="pk_xy_proj_item_prod_cfm"/>
								name="pk_xy_proj_item_prod_cfm" />
						</td>
						
						<td width="100px" height="30" align="center" bgcolor="#E8EBF0">
							<bean:write name="supplierprice" property="message" />
						</td>
						
						<td width="100px" height="30" align="center" bgcolor="#E8EBF0">
							<bean:write name="supplierprice" property="prod_module" />
							
						</td>
						
						<td width="100px" height="30" align="center" bgcolor="#E8EBF0">
							<bean:write name="supplierprice" property="prod_quantity" />
							
						</td>
						
						<td width="100px" height="30" align="center" bgcolor="#E8EBF0">
							<bean:write name="supplierprice" property="prod_unit" />
						</td>
						
						
					</tr>
				</logic:iterate>
</table> 
-->

<!-- 
		<table width="900" border="0" cellpadding="0" cellspacing="1">
			<tr>
				<td height="35" colspan="8" align="left" class="f-13-b-2a6ca7">
					&nbsp;
				</td>
			</tr>
			<tr class="th_bj">
				<td width="120" height="28" colspan="-3" align="center">
					<span class="f-13-ffffff">规格</span>
				</td>
				<td width="70" align="center" class="f-13-ffffff">
					数量
				</td>
				<td width="100" align="center" class="f-13-ffffff">
					单位
				</td>

				<logic:equal value="1" name="pricemode">
					<td width="200" height="28" align="center">
						<span class="f-13-ffffff">目录单价(元)</span>
					</td>
					<td width="200" height="28" align="center">
						<span class="f-13-ffffff">正扣折扣率</span>
					</td>
					<td width="200" height="28" align="center" class="f-13-ffffff">
						折扣后单价(元)
					</td>
					<td width="200" align="center" class="f-13-ffffff">
						折扣后总价(元)
					</td>
					<td width="200" align="center" class="f-13-ffffff">
						生效日期
					</td>
					<td width="200" align="center" class="f-13-ffffff">

						失效日期
					</td>
				</logic:equal>
				
				<logic:equal value="3" name="pricemode">
					<td width="200" height="28" align="center">
						<span class="f-13-ffffff">单价(元)</span>
					</td>
					<td width="200" height="28" align="center">
						<span class="f-13-ffffff">正扣折扣率</span>
					</td>
					<td width="200" height="28" align="center" class="f-13-ffffff">
						折扣后单价(元)
					</td>
					<td width="200" align="center" class="f-13-ffffff">
						折扣后总价(元)
					</td>
				</logic:equal>
			</tr>

			<logic:iterate id="supplierprice" name="supplierprices">
				<tr>
					<td colspan="-3" align="center" height="30">
						${supplierprice.prod_module}
					</td>
					<td align="center" >
						${supplierprice.prod_quantity}
					</td>
					<td align="center">
						${supplierprice.prod_unit}
					</td>

					<logic:equal value="1" name="pricemode">
						<td align="center" height="30">
							0.00
						</td>
						<td align="center">
							0.00
						</td>
						<td align="center">
							0.00
						</td>
						<td align="center">
							0.00
						</td>
						<td align="center">
							YYYY-MM-DD
						</td>
						<td align="center">
							YYYY-MM-DD
						</td>
					</logic:equal>
					
					<logic:equal value="3" name="pricemode">
						<td align="center">
							0.00
						</td>
						<td align="center">
							0.00
						</td>
						<td align="center">
							0.00
						</td>
						<td align="center">
							0.00
						</td>
					</logic:equal>
				</tr>
			</logic:iterate>

		</table>
-->


  <!-- 下载文件 -->
 <!--  gh  20140114 修改样式，去掉之前的附件样式方式上传，改为直接上传
  <table width="610" border="0" cellpadding="0" cellspacing="0">
  	<tr>
  	
  	
	  	
  			<td style="width:610px" align="right"> 
  			
  			<font style="font-size:12px;color:red">上传报价信息:</font> 
				<input type="file" name="pricefile" id = "pricefile"
				
				<logic:equal value="0" name="ishavepricedata">disabled</logic:equal>
				
				/> &nbsp;
  			<input type="button" value="下载报价模板" onclick="submitdownpriceform()" 
  				<logic:equal value="0" name="ishavepricedata">disabled</logic:equal>
  			/>
  			</td>
  	</tr>
  </table>
 -->
 
<p>&nbsp;</p>
  <table width='610' border="0" cellpadding="0" cellspacing="0">
  	<tr>
  			<td align='left' class="f-13-b-2a6ca7" width='200px'>填写报价信息</td><td style="width:410px" align="right"> 
  			
  			<input type="button" value="下载报价模板" onclick="submitdownpriceform()" 
  				<logic:equal value="0" name="ishavepricedata">disabled</logic:equal>
  			/>
  			
  			
  			<input type="button" value="导入报价信息"  onclick="importPrice()" 
  			<logic:equal value="0" name="ishavepricedata"> disabled</logic:equal>  
  			/>
  			
  			<input type="button" value="增加报价信息" onclick="addpricemessage()"
  			<logic:equal value="0" name="ishavepricedata">disabled</logic:equal>
  			/>
  			
  			</td>
  	</tr>
  </table>

<div style='width:610px;overflow:hidden;' id="movediv" > 
<table  border="0" cellpadding="0" cellspacing="0"  
<logic:equal value="3" name="pricemode">
		style="width:1370px"
</logic:equal>

<logic:equal value="1" name="pricemode">
		style="width:1370px"
</logic:equal>
		>
	
	<thead>
		<tr class="th_bj" >
		
			<th style='width:70px' height="28" align="center" class="f-13-ffffff">
											是否评标
			</th>
			<th style='width:140px' height="28" align="center" class="f-13-ffffff">
											产品/服务名称
			</th>
			
			<th style='width:80px' height="28"  align="center">
					<span class="f-13-ffffff">型号</span>
			</th>
			<th style='width:130px' height="28"  align="center">
					<span class="f-13-ffffff">详细描述</span>
			</th>
			
				<th style='width:60px' align="center" class="f-13-ffffff">
					数量
				</th>
				<th style='width:60px' align="center" class="f-13-ffffff">
					单位
				</th>

				<logic:equal value="1" name="pricemode">
					<th style='width:180px' height="28" align="center">
						<span class="f-13-ffffff">列表单价</span>
					</th>
					<th style='width:140px' height="28" align="center">
						<span class="f-13-ffffff">正折扣率（%）</span>
					</th>
					<th style='width:140px' height="28" align="center" class="f-13-ffffff">
						折扣后单价
					</th>
					<th style='width:140px' align="center" class="f-13-ffffff">
						折扣后总价
					</th>
					<!--  
					<th style='width:140px' align="center" class="f-13-ffffff">
						生效日期
					</th>
					<th style='width:140px' align="center" class="f-13-ffffff">

						失效日期
					</th>
					-->
				</logic:equal>
				
				<logic:equal value="3" name="pricemode">
					<th style='width:160px' height="28" align="center">
						<span class="f-13-ffffff">列表单价</span>
					</th>
					<th style='width:160px' height="28" align="center">
						<span class="f-13-ffffff">正折扣率（%）</span>
					</th>
					<th style='width:160px' height="28" align="center" class="f-13-ffffff">
						折扣后单价
					</th>
					<th style='width:160px' align="center" class="f-13-ffffff">
						折扣后总价
					</th>
				</logic:equal>
				
				
				<th style='width:160px' height='28' align='center' class="f-13-ffffff">
				备注
				</th>
				
				
		  <th style='width:60px' height="28"  align="center">
					<span class="f-13-ffffff">操作</span>
			</th>
	</tr>	
</thead>
	</table>
</div>



<div style='width:610px; overflow:auto; height:200px;margin-left:0px;' 
onscroll='setScrollData(this)'>
	<table 
	
	<logic:equal value="3" name="pricemode">
		style="width:1370px"
</logic:equal>

<logic:equal value="1" name="pricemode">
		style="width:1370px"
</logic:equal>

	
	border="0" cellpadding="0" cellspacing="0"  id="pricetable" >	
	<logic:iterate id="spricemes" name="spricemess">
	<tr  id='${spricemes.index}'>
	<input type="hidden" id="zdy4" value="${spricemes.zdy4}"/>
		<logic:equal value="1" name="spricemes" property="zdy4" >	
		<td  height="28" align="center"  style='width:50px'>
				<input type='text'  name='is_eval' 
				style='width:20px' 
				value="是" readonly/>
				<input type="hidden"  name='zdy3' value="${spricemes.zdy3}"/>
			</td>
			  <td  height="28" align="center"  style='width:160px'>
				<input type='text'  name='prod_name' 
				style='width:140px' 
				value="${spricemes.prod_name }" readonly/>
			</td>
		</logic:equal>
		<logic:notEqual value="1" name="spricemes" property="zdy4">
		<td  height="28" align="center"  style='width:50px'>
				<input type='text'  name='is_eval' 
				style='width:20px' 
				value="否" readonly/>
				<input type="hidden"  name='zdy3' value="${spricemes.zdy3}"/>
			</td>	
			  <td  height="28" align="center"  style='width:160px'>
				<input type='text' name='prod_name'  
				style='width:140px' 
				value="${spricemes.prod_name }" />
			</td>
		</logic:notEqual>
			
			<td  height="28"  align="center" style='width:100px'>
					<input type='text' name='prod_spe1' style="width:50px" value="${spricemes.spe }" />
			</td>
			<td style='width:140px' height="28"  align="center" >
					<input type='text' name='message' style="width:60px" value="${spricemes.message }"/>
			</td>
			
				<td style='width:70px' align="center" >
					<input type='text' name='quantity' id='number${spricemes.index}' style="width:43px" value="${spricemes.prod_quantity }" onchange="calPriceAndTotal('${spricemes.index}')"/>
				</td>
				<td style='width:70px' align="center" >
					<input type='text' name='pk_unit' style="width:42px" value="${spricemes.prod_unit }"/>
				</td>

				<logic:equal value="1" name="pricemode">
					<td style='width:160px' height="28" align="center">
						<input type='text' id ='price${spricemes.index}' style="width:80px"  name='cata_unit_price' value="${spricemes.cata_unit_price }" onchange="calPriceAndTotal('${spricemes.index}')" />
					</td>
					<td style='width:160px' height="28" align="center">
						<input type='text' id='discount${spricemes.index}' style="width:82px" name='discount' value="${spricemes.discount }" onchange="calPriceAndTotal('${spricemes.index}')" />
					</td>
					<td style='width:160px' height="28" align="center" >
						<input type='text' id='unitprice${spricemes.index}' style="width:80px" name='discounted_unit_price' value="${spricemes.discounted_unit_price }" onchange="calPriceAndTotal('${spricemes.index}')"/>
					</td>
					<td style='width:160px' align="center" >
						<input type='text' id='amount${spricemes.index}' style="width:90px" name='discounted_amount' value="${spricemes.discounted_amount }" onchange="calPriceAndTotal('${spricemes.index}')"/>
					</td>
					<!--  
					<td style='width:160px' align="center" >
						<input type='text' name='valid_date' onclick='WdatePicker()' style="width:80px" value="${spricemes.valid_date }"/>
					</td>
					<td style='width:160px' align="center" >

						<input type='text' name='unvalid_date' onclick='WdatePicker()' style="width:80px" value="${spricemes.unvalid_date }"/>
					</td>
					-->
				</logic:equal>
				
				<logic:equal value="3" name="pricemode">
					<td style='width:160px' height="28" align="center">
						<input type='text' id ='price${spricemes.index}' style="width:89px"  name='cata_unit_price' value="${spricemes.cata_unit_price }" onchange="calPriceAndTotal('${spricemes.index}')" />
					</td>
					<td style='width:180px' height="28" align="center">
						<input type='text' id='discount${spricemes.index}' style="width:82px" name='discount' value="${spricemes.discount }" onchange="calPriceAndTotal('${spricemes.index}')" />
					</td>
					<td  height="28" align="center" style='width:180px'>
						<input type='text' id='unitprice${spricemes.index}' style="width:80px" name='discounted_unit_price' value="${spricemes.discounted_unit_price }" onchange="calPriceAndTotal('${spricemes.index}')" />
					</td>
					<td style='width:160px' align="center" >
						<input type='text' id='amount${spricemes.index}' style="width:100px" name='discounted_amount' value="${spricemes.discounted_amount }" onchange="calPriceAndTotal('${spricemes.index}')" />
					</td>
				</logic:equal>
				
				
				<td style='width:160px' height='28' align='center' >
					<input type='text' name='memo1' style="width:80px" value="${spricemes.memo }"/>
				</td>
			<logic:equal value="1" name="spricemes" property="zdy4" >	
			  <td style='width:60px' height="28"  align="center">
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			  </td>
			</logic:equal>
			<logic:notEqual value="1" name="spricemes" property="zdy4">	
			  <td style='width:60px' height="28"  align="center">
					<input type='button' value='删除' onclick=removeprice('${spricemes.index}') style='width:40px' 
						 />
				</td>
			</logic:notEqual>
			  </tr>
	</logic:iterate>

</table>
</div>
<logic:equal value="3" name="pricemode">
<table>
	<tr>
	<td   style='width:160px'>
	</td>
	<td   style='width:160px'>
	</td>
	<td   style='width:160px'>
	</td>
	<td   style='width:160px'>
		<font style="font-size:12px;color:red">总计：${totalmoney }￥</font>
	</td>
	</tr>
</table>
</logic:equal>
<span>&nbsp;</span>

<table style="width:610px" border="0" cellpadding="0" cellspacing="0">

		<tr>
				<td><font style="font-size:12px;color:red">付款方式:</font></td>
				
				<td>
						<textarea rows="5" cols="20"  name="paymode" 
						
							<logic:equal value="0" name="ishavepricedata">disabled</logic:equal>
						>${other.paymode}</textarea>
				</td>
				
				<td><font style="font-size:12px;color:red">供货期:</font></td>
				
				<td>
						<textarea rows="5" cols="20"  name="supplierstage"
						<logic:equal value="0" name="ishavepricedata">disabled</logic:equal>
						>${other.supplierstage}</textarea>
				</td>
		</tr>

		<tr>
				<td><font style="font-size:12px;color:red">税率说明:</font></td>
				
				<td>
						<textarea rows="5" cols="20"  name="faxmessage"
						
						<logic:equal value="0" name="ishavepricedata">disabled</logic:equal>
						>${other.faxmessage}</textarea>
				</td>
				
				
				<td><font style="font-size:12px;color:red">其他说明:</font></td>
				
				<td>
						<textarea rows="5" cols="20"  name="othermessage"
						
						<logic:equal value="0" name="ishavepricedata">disabled</logic:equal>
						
						>${other.othermessage}</textarea>
				</td>
		</tr>
		
		

</table>
</div>
</div>


<!-- 供应商应答说明 -->
<table width="610" border="0" cellpadding="0" cellspacing="0" style="display:none">

<tr>
	<td colspan='2'>&nbsp;</td>
</tr>
   <tr>
          <td width="12%" align="left" valign="top">说明：</td>
          <td width="88%"><textarea name="memo" id="textarea2" cols="68" rows="10" style="display:none">${memo}</textarea></td>
        </tr>
</table>
  <table width="610" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td width="230" height="40">&nbsp;</td>
      <td width="82"><img src="../images/botton_submit.jpg" width="60"  style="cursor:hand" height="20" border="0" onclick="submitValue()"/></td>
      <td width="102"><img src="../images/botton_cancellation .jpg" width="60" style="cursor:hand" height="20" border="0" onclick="resetValue()"/></td>
      <td width="196">&nbsp;</td>
    </tr>
  </table>
  </div>
<input type="hidden" id="submitstate" value="${submitstate}"/>
</form>

<%if(Constant.CAOPEN){ %>
<OBJECT id="CertSignAtl"  codebase="<%=Constant.CAURL%>"  height="0" hspace="0" width="0" align="center" classid="clsid:4FEA81CE-00EA-4FB2-850E-353C947B7A66" VIEWASTEXT>
</OBJECT>  
<%} %>
<TEXTAREA id="certtxt" name="certtxt" rows="17" cols="48"  style="display: none" >${cert}</TEXTAREA>



   <!-- 报价类型 -->
   <input type="hidden" value="${pricemode}" id="pricemode"/>
   
<script language="vbscript">


		sub upfileSign(fileobject,index)

			Dim strP7Env
			Dim strSignature
			Dim strCert
			Dim ret
            Dim filepath	
			Dim objvalue

 			objvalue = 	 checkFileType(fileobject)
			if objvalue = 0 Then
			      return
			end if

			

           
            filepath = fileobject.value
			ret = 0 rem ret 必须赋初值
			
			
		   	if IsNull(CertSignAtl) then
					Alert("请确认您是否有权限上载文件")
					return
			end if


			   CertSignAtl.P7EncryptAndSignFile ret,certtxt.value,filepath,strP7Env,strSignature

				
			     If ret = 0 Then
				       call schange(fileobject,strP7Env,strSignature)
		
			     Else
					showmess("加密失败,请重新选择附件！")
			     End If
           

		end sub

</script>
<script language="javascript"><!--
parent.hideHideFun();

var message = "${dealmessage}";
if(message != ""){
	parent.showHideFun();
	parent.changeShowMessage(message,'yes','ok');	
}
//设置供应商已经报价的个数
var pricetableindex = ${pricelength};

var ishavepricedata = ${ishavepricedata};

var update_mode = ${update_mode};

var ranMsg = new randomMsg();

function onshowdiv(divobj){

	
	var obj = document.getElementById("jiam");
	
	if(obj != null){
		if(obj.style.display == "none"){
			obj.style.display = "";	
			divobj.innerHTML = "第一步：文件加密(隐藏-)";
		}else{
			obj.style.display = "none";
			divobj.innerHTML = "第一步：文件加密(展开+)";
		}
	}
}
/*
	添加供应商报价信息
*/
function addpricemessage()
{
		var pricemode = document.all("pricemode");
		var pricemodevalue = pricemode.value;
		var pricetable = document.all("pricetable");
		

var submitstate = document.all("submitstate");
	if(submitstate.value != '3'){
	
		showmess("应答已经结束不能进行应答!");
		return;
	}
	if(change.distance <= 0 ){
	
		showmess("应答已经过期不能进行应答!");
		return;
			
	}
		//判断报价类型是否符合系统设置类型
		if(pricemodevalue != 1 )
		{
			if( pricemodevalue != 3)
			{
				showmess("报价类型有误，无法添加报价信息!");
				return ;
			}
		}
		
		//判断报价模板中是否有产品信息
		
		if(typeof(ishavepricedata) == 'undefined' || ishavepricedata == 0)
		{
			showmess("报价模板没有产品信息,供应商不需要填写报价信息!");
			return;
		}
		
		if(update_mode != '1')
		{
			showmess("供应商已经被废弃或淘汰不能添加报价信息!");
			return;
		}
		

		
	 	if(pricetable != null)
	 	{
	 		var row = pricetable.insertRow();
	 		
	 		pricetableindex++;
	 		
	 		row.style.height = '26px';
	 		row.id = pricetableindex;
	 		
	        //判断报价类型
	 		if(pricemodevalue == 1)
		 	{
		 		var cell = row.insertCell();

		 		cell.style.width = '50px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='text' value='否' name='is_eval' style='width:20px' readonly/><input type='hidden'  name='zdy3' value=''/>";

		 		
		 		cell = row.insertCell();
		 		cell.style.width = '160px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='text' name='prod_name' style='width:140px'/>";
		 		
		 		cell = row.insertCell();
		 		cell.style.width = '100px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='text' name='prod_spe1' style='width:50px'/>";
		 		
		 		cell = row.insertCell();
		 		cell.style.width = '140px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='text' name='message' style='width:60px'/>";
		 		
		 		
		 		cell = row.insertCell();
		 		cell.style.width = '70px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='text' name='quantity' id='number"+pricetableindex+"' style='width:43px' onchange=calPriceAndTotal('"+pricetableindex+"') />";
		 		
		 		cell = row.insertCell();
		 		cell.style.width = '70px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='text' name='pk_unit' style='width:42px'/>";
		 		
		 		
		 		cell = row.insertCell();
		 		cell.style.width = '160px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='text' id ='price"+pricetableindex+"' style='width:80px'  name='cata_unit_price' onchange=calPriceAndTotal('"+pricetableindex+"') />";
		 		
	
		 		cell = row.insertCell();
		 		cell.style.width = '160px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='text' id='discount"+pricetableindex+"' style='width:80px' name='discount'  onchange=calPriceAndTotal('"+pricetableindex+"') />";
		 		
		 		
		 		cell = row.insertCell();
		 		cell.style.width = '160px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='text' id='unitprice"+pricetableindex+"' style='width:80px' name='discounted_unit_price' onchange=calPriceAndTotal('"+pricetableindex+"') />";
		 		
		 		
		 		cell = row.insertCell();
		 		cell.style.width = '160px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='text' id='amount"+pricetableindex+"' style='width:90px' name='discounted_amount' onchange=calPriceAndTotal('"+pricetableindex+"') />";
		 		
		 		/*
		 		cell = row.insertCell();
		 		cell.style.width = '160px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='text' name='valid_date' onclick='WdatePicker()' style='width:80px' />";
		 		
		 		
		 		cell = row.insertCell();
		 		cell.style.width = '160px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='text' name='unvalid_date' onclick='WdatePicker()' style='width:80px' />";
				*/
		 		
		 		cell = row.insertCell();
		 		cell.style.width = '160px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='text' name='memo1' style='width:80px' />";
		 		
				cell = row.insertCell();
		 		cell.style.width = '60px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='button' value='删除' onclick=removeprice('"+pricetableindex+"') style='width:40px' />";
		 		
				
		 	}else if(pricemodevalue == 3)
		 	{
		 	
		 	
		 		var cell = row.insertCell();
		 		
		 		cell.style.width = '50px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='text' value='否' name='is_eval' style='width:20px' readonly/><input type='hidden'  name='zdy3' value=''/>";
		 		
		 		
		 		
		 		cell = row.insertCell();
		 		cell.style.width = '160px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='text' name='prod_name' style='width:140px'/>";
		 		
		 		
		 		cell = row.insertCell();
		 		cell.style.width = '100px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='text' name='prod_spe1' style='width:50px'/>";
		 		
		 		cell = row.insertCell();
		 		cell.style.width = '140px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='text' name='message' style='width:60px'/>";
		 		
		 		
		 		cell = row.insertCell();
		 		cell.style.width = '70px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='text' name='quantity' id='number"+pricetableindex+"' style='width:43px' onchange=calPriceAndTotal('"+pricetableindex+"') />";
		 		
		 		
		 		cell = row.insertCell();
		 		cell.style.width = '70px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='text' name='pk_unit' style='width:42px'/>";
		 		
		 		
		 		cell = row.insertCell();
		 		cell.style.width = '160px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='text' id ='price"+pricetableindex+"' style='width:89px'  name='cata_unit_price' onchange=calPriceAndTotal('"+pricetableindex+"') />";
		 		
		
		 		cell = row.insertCell();
		 		cell.style.width = '160px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='text' id='discount"+pricetableindex+"' style='width:82px' name='discount'  onchange=calPriceAndTotal('"+pricetableindex+"') value='100'/>";
		 		
		 
		 		cell = row.insertCell();
		 		cell.style.width = '160px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='text' id='unitprice"+pricetableindex+"' style='width:100px' name='discounted_unit_price' onchange=calPriceAndTotal('"+pricetableindex+"') />";
		 		
		 		
		 		cell = row.insertCell();
		 		cell.style.width = '160px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='text' id='amount"+pricetableindex+"' style='width:100px' name='discounted_amount' onchange=calPriceAndTotal('"+pricetableindex+"') />";
		 		
		 		
		 		cell = row.insertCell();
		 		cell.style.width = '160px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='text' name='memo1' style='width:80px'/>";
		 		
		 		
				cell = row.insertCell();
		 		cell.style.width = '60px';
		 		cell.style.height = '28px';
		 		cell.align = 'center';
		 		cell.innerHTML = "<input type='button' value='删除' onclick=removeprice('"+pricetableindex+"') style='width:40px'/>";
		 		
		 	}
	 	}	
}

/*
判断删除附件需要验证附加是否已经关闭
*/
function deleteFile(attpk,distance)
{
	var pk_xy_proj_main = document.getElementById("pk_xy_proj_main");
	var url = "uploadfile.do?type=3&attpk="+attpk+"&pk_xy_proj_main="+pk_xy_proj_main.value+"&"+Math.random();
	ajax(url,returnFunctions);
}

function returnFunctions(result)
{
	
	if(result != null)
	{
		var results = result.split(",");
		if(results[0] == "ok")
		{
			deleteAttFile(results[1],${dismill});
		}else
		{
			parent.showHideFun();
			parent.changeShowMessage("项目已经完成或者已经截止，无法删除附件!",'yes','ok');	
		}
	}else
	{
		parent.showHideFun();
		parent.changeShowMessage("项目已经完成或者已经截止，无法删除附件!",'yes','ok');	
		
	}
}


/*
判断上传的报价模板是否是excel文件格式
*/
function submitValue()
{
	var pricetable = document.all("pricetable");
	var submitstate = document.all("submitstate");
	
	var pricefile = document.all("pricefile");
	
	var submitstate = document.all("submitstate");

	var pub_types = document.getElementsByName("pub_type");
	if(submitstate.value != '3'){
	
		showmess("应答已经结束不能进行应答!");
		return;
	}
	if(change.distance <= 0 ){
	
		showmess("应答已经过期不能进行应答!");
		return;
			
	}
	
	if(update_mode != '1')
	{
		showmess("供应商已经被废弃或淘汰不能添加上传文件!");
		return;
	}

	if(pub_types != null && typeof(pub_types) == 'object'){

		var length = pub_types.length;
		for(var index=0; index<length; index++){

				if(pub_types[index].value == ''){
					showmess("请选择上传加密投标文件类型!");
					return;
				}
		}
	}
	
	//因为现在不采取这样方式上传了，所以不在判断
	//判断上传报价模板的文件格式是否正确
    //if(pricefile.value != "")
    //{
    //	if(pricefile.value.substr(pricefile.value.lastIndexOf(".")+1,3) != "xls")
    //	{
    //		showmess("报价模板只支持excel文件!");
    //		return;
    //	}
    //}
	//判断是否有报价信息
    var cata_unit_price = document.getElementsByName("cata_unit_price");
    var prod_name = document.getElementsByName("prod_name");
    var prod_spe1 = document.getElementsByName("prod_spe1");
    var message = document.getElementsByName("message");
    var quantity = document.getElementsByName("quantity");
    var pk_unit = document.getElementsByName("pk_unit");
    var discount = document.getElementsByName("discount");
    var discounted_unit_price = document.getElementsByName("discounted_unit_price");
    var discounted_amount = document.getElementsByName("discounted_amount");
    
    if(ishavepricedata != 0){
    if(prod_name.length == 0){
    	showmess("请添加报价信息！");
  		return;
    }else{
    	if(prod_name != null){
    		
			if(prod_name.length >0){
			
				for(var index=0; index<prod_name.length; index++){
				
					var prod_names = prod_name[index];
					var prod_spe1s = prod_spe1[index];
					var messages = message[index];
					var quantitys = quantity[index];
					var pk_units = pk_unit[index];
					var cata_unit_prices = cata_unit_price[index];
					var discounts = discount[index];
					var discounted_unit_prices = discounted_unit_price[index];
					var discounted_amounts = discounted_amount[index];

					prod_names.style.backgroundColor = "white";
					prod_spe1s.style.backgroundColor = "white";
					messages.style.backgroundColor = "white";
					quantitys.style.backgroundColor = "white";
					pk_units.style.backgroundColor = "white";
					cata_unit_prices.style.backgroundColor = "white";
					discounts.style.backgroundColor = "white";
					discounted_unit_prices.style.backgroundColor = "white";
					discounted_amounts.style.backgroundColor = "white";

					if(prod_names.value  == null ||prod_names.value == ""){
					
					showmess("产品/服务名称不能为空!");
					
					return;
					}
					if(prod_spe1s.value  == null ||prod_spe1s.value == ""){
						
						showmess("型号不能为空!");
						prod_spe1s.style.backgroundColor = "yellow";
						return;
					}
					if(messages.value  == null ||messages.value == ""){
						
						showmess("详细描述不能为空!");
						messages.style.backgroundColor = "yellow";
						return;
					}
					if(quantitys.value  == null ||quantitys.value == ""){
						
						showmess("数量不能为空!");
						quantitys.style.backgroundColor = "yellow";
						return;
					}
					if(pk_units.value  == null ||pk_units.value == ""){
						
						showmess("单位不能为空!");
						pk_units.style.backgroundColor = "yellow";
						return;
					}
					
					if(isNaN(parseFloat(cata_unit_prices.value)) || cata_unit_prices.value == ""){
					
						showmess("请填入正确的列表单价!");
						cata_unit_prices.style.backgroundColor = "yellow";
						return;
					}
					if(isNaN(parseFloat(discounts.value)) || discounts.value == ""){
						
						showmess("请填入正确的正扣折扣率(%)!");
						discounts.style.backgroundColor = "yellow";
						return;
					}
					if(isNaN(parseFloat(discounted_unit_prices.value)) || discounted_unit_prices.value == ""){
						
						showmess("请填入正确的折扣后单价!");
						discounted_unit_prices.style.backgroundColor = "yellow";
						return;
					}
					if(isNaN(parseFloat(discounted_amounts.value)) || discounted_amounts.value == ""){
						
						showmess("请填入正确的折扣后总价!");
						discounted_amounts.style.backgroundColor = "yellow";
						return;
					}
					
				}
			}
		
		}

    }
	}
	   
	  // if(change.distance > 0 && submitstate.value == '3')
	//应答时间已经结束无法上传信息 
	if(change.distance > 0 )
	{
		parent.showHideFun();
		parent.changeShowMessage("数据处理中,请等候.....");
		document.insertPriceItemForm.submit();
	}
}

//清空form中数据
function resetValue()
{
	var submitstate = document.all("submitstate");
	
	if(change.distance > 0 && submitstate.value == '3')
	{
		document.insertPriceItemForm.reset();
	}
}
function SignFlag()
{
	this.flag = 1;
}
var sign = new SignFlag();
//使用ajax调用签名方法
function supquoteSign(pk)
{
var submitstate = document.all("submitstate");
	if(submitstate.value != '3'){
	
		showmess("应答已经结束不能进行应答!");
		return;
	}
	if(change.distance <= 0 ){
	
		showmess("应答已经过期不能进行应答!");
		return;
			
	}
	
	var url = "supquote.do?type=1&pk_xy_sup_quote_rec_sup="+pk+"&"+Math.random();
		parent.showHideFun();
		parent.changeShowMessage("开始签名!");
		ajax(url,returnFunction);
	
}

function returnFunction(value)
{

	if(value != null)
	{
		if(value == "ok")
		{
			parent.changeShowMessage("签名成功!",'yes','ok');	
		}else
		{
			parent.changeShowMessage("签名失败!",'yes','ok');	
		}
	}else
	{
		parent.changeShowMessage("签名失败!",'yes','ok');	
		
	}
}

var change  = new timechange();

//设置时间长度
change.setDistance(${dismill});

//唤醒时间计算方法
wakeInterval();




var rowindex = 0;
var temprowindex = 0;
//向批量上传文件的列表中添加一行数据
function addRow()
{
	var submitstate = document.all("submitstate");
	
	if(submitstate.value != '3'){
	
		showmess("应答已经结束不能进行应答!");
		return;
	}
	if(change.distance <= 0 ){
	
		showmess("应答已经过期不能进行应答!");
		return;
			
	}
	
	if(update_mode != '1')
	{
		showmess("供应商已经被废弃或淘汰不能添加上传文件!");
		return;
	}
	if(change.distance > 0)
	{
     var root = document.all("fileuploadtable")
     var row = root.insertRow();
     
     row.style.height = '26px';
     rowindex++;
     temprowindex++;
     row.id = "row"+rowindex;
     var cell1 = row.insertCell();
     
     cell1.align="center";
     cell1.innerText = temprowindex;
     var cell2 = row.insertCell();
     
     cell2.align="center";
     
     
	
	 var cell4= row.insertCell();
     
    
     var eventHandle = "<%if(Constant.CAOPEN){ %>FileChange(this,"+rowindex+")"<%}else{%>FileChange(this,"+rowindex+")"<%}%>;
    
	 //var eventHandle = "onsrcFileChange(this,"+rowindex+")";
    
    	
     var innercontent = "<input type='file'  name='inputfile"+rowindex+"' id='file"+rowindex+"' style='position:absolute;opacity:0;filter:alpha(opacity=0); width:20px; height:20px' onchange='"+eventHandle+"' />";

     var pub_type_inner = "<select name='pub_type' value=''><option value=''></option><option value='1'>报价文件</option><option value='2'>技术商务文件</option></select>&nbsp;";
     cell4.innerHTML = innercontent+pub_type_inner;

     var cell3 = row.insertCell();
     
      
     cell3.align="center";
     
     var img = "<input type='hidden' name = 'filecontent' id='filecontent"+rowindex+"'  /><input type='hidden' name='signfile' id='signfile"+rowindex+
     "'/><input type='hidden' name='filename' id='filename"+rowindex+"' /><img src='../images/botton_upload-.jpg' id='img"+rowindex+"' style='cursor:hand' border=0 style='cursor:hand'  onmouseover='showfiledialog("+rowindex+")'/>&nbsp<img src='../images/botton_delete.jpg' style='cursor:hand' border=0 style='cursor:hand' onclick='deleteRow("+rowindex+")'/>";
     cell3.innerHTML = img;  
     } 
}


//删除上传文件
function deleteRow(index)
{
	var root = document.all("fileuploadtable");
	var row = "row"+index ;
	
	var rows = root.rows;
    var deletepos = 0;
    
    
    //寻找到对应的删除行并进行删除
	for(var pos = 0; pos < rows.length; pos++)
	{
		var temprow = rows[pos];
		if(temprow.id == row)
		{
			root.deleteRow(pos);
			deletepos = pos;
			temprowindex--;
			break;
		}
	}
	
	
	//当删除行操作时更新显示索引
	for(var pos = deletepos; pos < rows.length; pos++)
	{
		var temprow = rows[pos];
		var cells = temprow.cells;
		
		var cell = cells[0];
		
		if(typeof(cell) == 'object')
		{
			cell.innerText = deletepos-1;
			deletepos++;
		}
	}	

}


//删除添加附件出错之后的连接
function deleteUpRow(row)
{
	var root = document.all("fileuploadtable");
	//var row = "row"+index ;
	
	var rows = root.rows;
    var deletepos = 0;
    

    
    //寻找到对应的删除行并进行删除
	for(var pos = 0; pos < rows.length; pos++)
	{
		var temprow = rows[pos];
		if(temprow.id == row)
		{
			root.deleteRow(pos);
			deletepos = pos;
			temprowindex--;
			break;
		}
	}
	
	//当删除行操作时更新显示索引
	for(var pos = deletepos; pos < rows.length; pos++)
	{
		var temprow = rows[pos];
		var cells = temprow.cells;
		
		var cell = cells[0];
		
		if(typeof(cell) == 'object')
		{
			cell.innerText = deletepos-1;
			deletepos++;
		}
	}	

}


//下载价格模板
function submitdownpriceform()
{

var submitstate = document.all("submitstate");
	if(submitstate.value != '3'){
	
		showmess("应答已经结束不能进行应答!");
		return;
	}
	if(change.distance <= 0 ){
	
		showmess("应答已经过期不能进行应答!");
		return;
			
	}
	var downpriceform = document.all("downpriceform");
	
	if(update_mode == '1')
	{
		if(downpriceform != null)
		{
			downpriceform.submit();
		}
	}else
	{
		showmess("供应商已经被废弃或淘汰不能下载价格模板!");
	}
}

function checkFileType(obj){

	var submitstate = document.getElementById("submitstate");
	if(submitstate.value != '3'){
	
		showmess("应答已经结束不能进行应答!");
		return 0;
	}
	if(change.distance <= 0 ){
	
		showmess("应答已经过期不能进行应答!");
		return 0;
	}

	if(obj != null && typeof(obj) != "undefined"){
		var filePath = obj.value;    
	    var fileSystem = new ActiveXObject("Scripting.FileSystemObject");       
	    var file = fileSystem.GetFile (filePath);    
	    fileSize = file.Size;
	    if(fileSize > 1024*1024*20 ){
	    	showmess("需要加密的文件,文件大小不能超过20M!");
	    	return  0;
	    }

		
		if(obj.value != ""){
			var filetype = obj.value.substring(obj.value.lastIndexOf(".")+1,obj.value.length);
			 if(filetype == "zip" || filetype == "rar"){
				 return 1;
			 }
		}
	}
	
	
	showmess("请选择文件类型为rar或zip的压缩文件进行加密!");
	return  0;
}

function schange(obj,strmicontent,strSignature){

	    var msg = "";
		if(obj != null && typeof(obj) != "undefined"){
			
			if(obj.value != ""){
			var filetype = obj.value.substring(obj.value.lastIndexOf(".")+1,obj.value.length);
			var msgshow = document.getElementById("msgid");
			msgshow.innerHTML = "<p></p>";
	        if(filetype == "zip" || filetype == "rar"){
	                 //把文件的路径进行截取显示文件的名称
	             var filepath =  obj.value.substring(0,obj.value.lastIndexOf("\\")+1);
	             //msg += "文件路径:"+filepath;
	             //设置文件名称
	             var filename = obj.value.substring(obj.value.lastIndexOf("\\")+1,obj.value.lastIndexOf("."));
	             //msg += "<br>文件名称:"+filename;
	             //msg += "<br>文件类型:"+filetype;
	             var randomApp = ranMsg.birthRandom(filename,filetype,strSignature);
	             createFileMsg(strmicontent,filepath,filename+"_"+randomApp+"."+filetype);
	             //msg += "<br>文件 \""+filename+"\" 加密成功!";
	             msg += "生成加密后的文件为:"+filepath+filename+"_"+randomApp+"."+filetype;
	             msgshow.innerHTML = msg;
	             
	             
	             
	         }else{
	            
	            msgshow.innerHTML = "此文件的文件类型为"+filetype+",请选择文件类型为rar或zip的压缩文件进行加密!";
	         }
			}
			

		
		}
	}


	function createFileMsg(msg,filepath,filename){

		var fso, f;
		fso = new ActiveXObject("Scripting.FileSystemObject");
		f = fso.CreateTextFile(filepath+filename, true);
		f.WriteLine(msg);
		f.Close();
	}


	function onsrcFileChange(fileobject,index){

		var filetype = fileobject.value.substring(fileobject.value.lastIndexOf("\\")+1,fileobject.value.length);

		var signmsg = ranMsg.getSignMsg(filetype);
		<% if(Constant.CAOPEN){ %>
		if(signmsg == ""){
			deleteRow(index);
			showmess("请选择加密文件!");
			return;
		}
		<%}%>
		ondatachange(fileobject,index,signmsg,null);
	}

	function FileChange(fileobject,index){

		//ondatachange(fileobject,index);
		var pricetable = document.all("pricetable");
		var submitstate = document.all("submitstate");
		
		var submitstate = document.all("submitstate");

		var pub_types = document.getElementsByName("pub_type");
		if(submitstate.value != '3'){
		
			showmess("应答已经结束不能进行应答!");
			return;
		}
		if(change.distance <= 0 ){
		
			showmess("应答已经过期不能进行应答!");
			return;
				
		}
		
		if(update_mode != '1')
		{
			showmess("供应商已经被废弃或淘汰不能添加上传文件!");
			return;
		}
		
		if(pub_types != null && typeof(pub_types) == 'object'){

			var length = pub_types.length;
			for(var indexs=0; indexs<length; indexs++){

					if(pub_types[indexs].value == ''){
						deleteUpRow("row"+index);
						showmess("请选择上传附件类型!");
						return;
					}
			}
		}
		
		//判断文件对象的值是否为空
		if(fileobject.value != null && fileobject.value != "")
		{
			var fileType = fileobject.value.substring(fileobject.value.lastIndexOf(".")+1,fileobject.value.length);
			//判断文件的大小
			var filePath = fileobject.value;    
		      var fileSystem = new ActiveXObject("Scripting.FileSystemObject");       
		      var file = fileSystem.GetFile (filePath);    
		      fileSize = file.Size;
		
			if((fileType == "zip" || fileType == "rar" || fileType == "7z") && fileSize < 1024*1024*30 ){
			//获取对应文件所在的位置
			 var row = document.all("row"+index);
			 
			 var cells = row.cells;
			 var cell = cells[1];
			 
			 //把文件的路径进行截取显示文件的名称
			 cell.innerHTML =  fileobject.value.substring(fileobject.value.lastIndexOf("\\")+1,fileobject.value.lastIndexOf("."));
			 
			 var filename = document.all("filename"+index);
			 //设置文件名称
			 filename.value = fileobject.value.substring(fileobject.value.lastIndexOf("\\")+1,fileobject.length);
			 //隐藏掉上传文件按钮
			 var img = document.all("img"+index);
			 
			 img.style.visibility = "hidden";
			 fileobject.style.display = "none";

			parent.showHideFun();
			parent.changeShowMessage("附件处理中,请等候.....");
			
			var url = "uploadfile.do?type=6";
			document.insertPriceItemForm.action = url;
			document.insertPriceItemForm.submit();
			 
			 }else{
				 deleteUpRow("row"+index);
			 	showmess("请上传文件类型为rar、zip、7z文件，且文件大小不能超过30M");
			 }
			 
		}
	}

	
	//导入价格信息
	function importPrice(){
		var submitstate = document.all("submitstate");
		if(submitstate.value != '3'){
		
			showmess("应答已经结束不能进行应答!");
			return;
		}
		if(change.distance <= 0 ){
		
			showmess("应答已经过期不能进行应答!");
			return;
				
		}
		//type类型表示是1发标还是2发布过来的报价信息
		var msg = window.showModalDialog("uploadtbfilemiddle.jsp?pk_xy_proj_main="+document.getElementById("pk_xy_proj_main").value+"&type=1&random"+Math.random(),null,
				"dialogHeight:150px;dialogWidth:400px;");
		toUrlRed();
	}

	//删除应答信息行项目判断
	function removeprice(index)
	{
	
		var submitstate = document.all("submitstate");
		if(submitstate.value != '3'){
		
			showmess("应答已经结束不能进行应答!");
			return;
		}
		if(change.distance <= 0 ){
		
			showmess("应答已经过期不能进行应答!");
			return;
				
		}
		removepricemessage(index);
		
	}


	function toUrlRed(){
		parent.window.location.href="/portal/collaborative/main.jsp?url=/portal/collaborative/uploadfile.do@pk_xy_proj_main="+document.getElementById("pk_xy_proj_main").value;
	}


--></script>
</body>
</html>
